package sctu.edu.java.year2016.team05.lizixin.day20160522.chapter5_2;

/**
 * Created by home on 2016/5/23.
 */
public class Mm { public static void main(String[] args) {
    int arr[] = new int[]{30, 80, 31, 1, 64, 8, 14, 76};
    System.out.println("输出一维数组：");
    for (int i = 0; i < arr.length; i++) {
        System.out.print(arr[i] + " ");
    }
    int theMax = arr[0];
    for (int j = 0; j < arr.length - 1; j++) {
        if (theMax < arr[j + 1]) {
            theMax = arr[j + 1];
        }
    }
    System.out.println("\n一维数组中的最大值为： " + theMax);

}
}
